libxl: permit declaration after statement
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 12 Dec 2011 17:48:39 +0000 (17:48 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 12 Dec 2011 17:48:39 +0000 (17:48 +0000)
GCC and C99 allow declarations to be mixed with code.  This is a good
idea because:

 * It allows variables to be more often initialised as they are
   declared, thus reducing the occurrence of uninitialised variable
   errors.

 * Certain alloca-like constructs (arrays allocated at runtime on the
   stack) can more often be written without a spurious { } block.
   Such blocks are confusing to read.

 * It makes it easier to write and use macros which declare and
   initialise formulaic variables and do other function setup code,
   because there is no need to worry that such macros might be
   incompatible with each other or have strict ordering constraints.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/Makefile

index 7a0c03c7bb2d6a40125456fb6acc27edb060715c..70c9c1cfe9188cedd984a5d6915115613be9d7aa 100644 (file)
@@ -11,7 +11,8 @@ MINOR = 0
 XLUMAJOR = 1.0
 XLUMINOR = 0
 
-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations
+CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
+       -Wno-declaration-after-statement
 CFLAGS += -I. -fPIC
 
 ifeq ($(CONFIG_Linux),y)